<div class="main_body">
    <?php echo $this->element('main_menu')?>		
	<div id="main_body_content">
	
		<div class="ordersSeries form">
		<?php echo $this->Form->create('OrdersSeries');?>
			<fieldset>
		 		<legend><?php __("Add Orders Series"); ?></legend>
		 		
		 		<div class="input select required">
		 			
					<label for="OrderSelectCustomerId"><?php __("Select Customer");?></label>
					<div class="customers index scrollable">
						
						<table cellpadding="0" cellspacing="0" class="items">
						<?php
						$i = 0;
						foreach ($orders as $order):
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>
						<tr<?php echo $class;?>>
							<td>
								<?php //echo $form->radio('customer_id',array($customer['Customer']['id']=>false),array('legend'=>false,'checked'=>((isset($this->data['Order']['customer_id']) && $this->data['Order']['customer_id'] ==  $customer['Customer']['id'])?"checked":"")));?>
								<input type="radio" name="data[OrdersSeries][orders_id]" id="OrdersSeriesOrdersId<?php echo $order['Orders']['id']?>" value="<?php echo $order['Orders']['id']?>" /> 
							</td>			
							<td><?php echo $order['Orders']['numer']; ?>&nbsp;<br/>
								<?php echo $order['Orders']['name']; ?>&nbsp;</td>
							<td><?php echo $order['Orders']['value_of_the_order']; ?> <?php echo __("USD",true)?><br/>
								<?php echo ( array_key_exists($order['Orders']['type_of_service_id'], $typeOfServices) ) ? $typeOfServices[$order['Orders']['type_of_service_id']] : ""; ?>&nbsp;</td>
							<td class="actions"><?php echo ( array_key_exists($order['Orders']['types_of_spaces_id'], $typesOfSpaces)) ? $typesOfSpaces[$order['Orders']['types_of_spaces_id']] : ""; ?>&nbsp;</td>
			
						</tr>
					<?php endforeach; ?>
						</table>
					</div>
				</div>
				<div class="clr"></div>
						 		
				<div class="input select required">
					<label for="OrderSelectEmployeeId"><?php __("Select Employee");?></label>
					<div class="customers index scrollable">
						
						<table cellpadding="0" cellspacing="0" class="items">
						
						<?php					
						$i = 0;
						foreach ($employees as $employee):
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>
						<tr<?php echo $class;?>>
							<td><input type="radio" name="data[OrdersSeries][employee_id]" id="OrdersSeriesEmployeeId<?php echo $employee['Employee']['id']?>" value="<?php echo $employee['Employee']['id']?>" /></td>	
							<td><?php echo $employee['Employee']['name']; ?><br/><?php echo $employee['Employee']['surname']; ?></td>
							<td><?php echo $employee['Employee']['address1']; ?><br/>
								<?php echo $employee['Employee']['address2']; ?></td>
							<td class="actions">
								<?php echo $typeOfWorks[$employee['Employee']['type_of_work_id']]; ?><br/>
								<?php echo (array_key_exists($employee['Employee']['type_of_work_2_id'], $typeOfWorks)) ? $typeOfWorks[$employee['Employee']['type_of_work_2_id']] : ""; ?><br/>
								<?php echo (array_key_exists($employee['Employee']['type_of_work_3_id'], $typeOfWorks)) ? $typeOfWorks[$employee['Employee']['type_of_work_3_id']] : ""; ?>
							</td>			
						</tr>
					<?php endforeach; ?>
						</table>
					</div>
				</div>
				<div class="clr"></div>
				<?php 
					echo $javascript->codeBlock("
						$(document).ready(function() {
							$( \"#OrdersSeriesExecutionDate\" ).datepicker({showButtonPanel: true, dateFormat: 'mm-dd-yy'});
						});
						",$options = array('allowCache'=>true,'safe'=>true,'inline'=>false));
				?> 		
				<?php
					echo $this->Form->input('execution_date',array('type'=>'text'));
					echo $this->Form->input('salary');
					echo $this->Form->input('payment_status',array('options'=>$paymentStatus,'empty'=>''));
					echo $this->Form->input('payment_numer');
					echo $this->Form->input('status',array('options'=>$statusOfImplementation,'empty'=>''));
					echo $this->Form->input('note');
				?>
			</fieldset>
		<?php echo $this->Form->end(__("Submit", true));?>
		</div>
		
		<div class="clr"></div>	
	</div>		
	<?php echo $this->element('languages')?>	
	<div class="clr"></div>
	<br/>
</div>	
<div class="clr"></div>	
<div class="main_action">
	<div class="main_action_content">
			
		<div class="actions">
			<h3><?php __("Actions"); ?></h3>
			<ul>
		
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_series.png'), array('action' => 'index'),array('title'=>__("List Orders Series", true),'escape'=>false)); ?><div class="clr"></div> <?php echo __("List Orders Series", true)?> </li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_orders_list.png'), array('controller'=>'orders','action' => 'index'),array('title'=>__("List Orders", true),'escape'=>false)); ?> <div class="clr"></div><?php echo __("List Orders",true)?></li>				
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_employees.png'), array('controller' => 'employees', 'action' => 'index'),array('title'=>__("List Employees", true),'escape'=>false)); ?><div class="clr"></div><?php echo __("List Employees", true)?> </li>
			</ul>
		</div>
		
		<div class="clr"></div>
	</div>		
</div>			